
import stu




if __name__ == '__main__':
    inputkey = "0"
    while inputkey != "5":
        print("1.删除数据")
        print("2.查看所有数据")
        print("3.新增数据")
        print("4.修改数据")
        print("5.退出")
        inputkey = input("请选择：")
        if inputkey == "1":
            delid = int(input("请输入要删除的ID:"))
            print(delid)
            stu1 = stu.StuInfo()
            stu1.delrecord(delid)
        elif inputkey == "2":
            stu1 = stu.StuInfo()
            stu1.findall()
        elif inputkey == "3":
            # data（name,sex,cdate,birthday,stuid）
            data = ('stu1', '1', '2018-09-01', '1999-05-16', '20180002')
            data = input("请输入要新增的数据（name,sex,cdate,birthday,stuid）:")
            stu1 = stu.StuInfo()
            stu1.addrecord(data)
        elif inputkey == "4":
            data = input("请输入要新增的数据（name,sex,cdate,birthday,stuid,id）:")
            stu1 = stu.StuInfo()
            stu1.updaterecord(data)
        elif inputkey == "5":
            print("你已退出")
        else:
            print("输入错误")